/* eslint-disable */
export function addSessionStorage(session_key,add_item){
    //规定add的session为list型，session_key为其名字，add_item为要添加的元素
    let items;
    if(isInSessionStorage(session_key)){
       items = JSON.parse(sessionStorage.getItem(session_key))
    }else{
       items = []
    }
    items.push(add_item)
    sessionStorage.setItem(session_key,JSON.stringify(items))
}

export function isInSessionStorage(session_name){
    // true 代表有
    const value = sessionStorage.getItem(session_name)
    return value !== null
}

